package com.itheima.service;

import com.itheima.domain.Book;
import com.itheima.domain.BookSelective;
import entity.PageResult;
import org.springframework.transaction.annotation.Transactional;


/**
 * Created with IntelliJ IDEA.
 * @Author: auuuu4
 * @Date: 2024/07/09/15:15
 * @Description:
 */
public interface BookService {
    PageResult selectNewBooks(Integer pageNum, Integer pageSize);

    Book findById(int id);


    @Transactional
    int borrowBook(Book book);

    PageResult selectBooks(Integer pageNum,Integer pageSize);

    PageResult selectBorrowedBooksByBorrower(String name);

    PageResult selectBorrowedBooks();
    PageResult selectBorrowedBooksSelective(Integer pageNum,Integer pageSize,BookSelective selective);
    @Transactional
    int returnBook(Integer id);
    @Transactional
    int returnConfirm(Integer id);

    @Transactional
    int addBook(Book book);

    int updateBook(Book book);
}
